/*
 * 
 * Proj. Wireless - UFRN
 * 
 */ 

package metodologia;

import gui.JFPStep;
import java.io.Serializable;

public class ToDoNode implements Serializable {

    /**
     * id: 0...n, n=start+end+node;
     * catId: 0-start; 0-end; 1...n, n=node;
     * type: 0-start; 1-end; 2-node;
     */
    private int id, type, catid; // good coding practice would have this as private
    private double X,Y;
    private JFPStep toDo;
    private int state;
    private boolean finished;

    public ToDoNode(int id, int type, int catid) {
        this.id = id;
        this.type = type;
        this.catid = catid;
        toDo = new JFPStep();
        state = 0;
    }

    @Override
    public String toString() { // Always a good idea for debuging
        switch (this.getType()) {
            case 0:
                return "Inicio";
            case 2:
                return "List" + " - " + getCatid();
            case 1:
                return "Final";
        }
        return "Erro";       // JUNG2 makes good use of these.
    }


    public int getType() {
        return this.type;
    }

    public int getCatid() {
        return this.catid;
    }

    public int getId() {
        return this.id;
    }

    public double getX() {
        return X;
    }

    public void setX(double X) {
        this.X = X;
    }

    public double getY() {
        return Y;
    }

    public void setY(double Y) {
        this.Y = Y;
    }

    public JFPStep getToDo() {
        return toDo;
    }

    public void setTodo(JFPStep todo) {
        this.toDo = todo;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setType(int type) {
        this.type = type;
    }

    public void setCatid(int catid) {
        this.catid = catid;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    /**
     * @return the finished
     */
    public boolean isFinished() {
        return finished;
    }

    /**
     * @param finished the finished to set
     */
    public void setFinished(boolean finished) {
        this.finished = finished;
    }
}
